package com.tedu.charging.service.user.dao;

import com.tedu.charging.service.user.pojo.po.UserVehicleBindPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tedu.charging.service.user.pojo.po.VehiclePO;
import org.apache.ibatis.annotations.Select;

/**
* @author zjj
* @description 针对表【charging_user_vehicle_bind】的数据库操作Mapper
* @createDate 2023-08-29 17:52:18
* @Entity com.tedu.charging.service.user.pojo.po.ChargingUserVehicleBindPO
*/
public interface UserVehicleBindMapper extends BaseMapper<UserVehicleBindPO> {
@Select("SELECT * FROM charging_vehicle\n" +
        "WHERE id=\n" +
        "(SELECT vehicle_id FROM charging_user_vehicle_bind\n" +
        "WHERE state=1 and user_id=#{userId} limit 1\n" +
        ") limit 1")
    public VehiclePO selectVehicleByUserId(Integer userId);
}




